class Article {
  String title;
  String description;
  String link;
  String guid;
  String pubDate;
  String author;

  static Article fromMap(Map<String, dynamic> map) {
    Article article = new Article();
    article.title = map['title'];
    article.description = map['description'];
    article.link = map['link'];
    article.guid = map['guid'];
    article.pubDate = map['pubDate'];
    article.author = map['author'];
    return article;
  }

  static List<Article> fromMapList(dynamic mapList) {
    List<Article> list = new List(mapList.length);
    for (int i = 0; i < mapList.length; i++) {
      list[i] = fromMap(mapList[i]);
    }
    return list;
  }

  Map<String, dynamic> toMap() {
    var map = Map<String, dynamic>();
    map['title'] = title;
    map['description'] = description;
    map['link'] = link;
    map['guid'] = guid;
    map['pubDate'] = pubDate;
    map['author'] = author;
    return map;
  }
}
